package com.think.admin.oauth.integration.authenticator;

import com.think.admin.oauth.integration.IntegrationAuthentication;
import org.springframework.security.core.userdetails.UserDetails;

/**
 * <p>
 * 认证器接口
 * </p>
 *
 * @author: xwj
 * @data: 2019-05-10
 */
public interface IntegrationAuthenticator {

    /**
     * 处理集成认证
     * @param integrationAuthentication
     * @return
     */
    UserDetails authenticate(IntegrationAuthentication integrationAuthentication);

    /**
     * 进行预处理
     * @param integrationAuthentication
     */
    void prepare(IntegrationAuthentication integrationAuthentication);

    /**
     * 判断是否支持集成认证类型
     * @param integrationAuthentication
     * @return
     */
    boolean support(IntegrationAuthentication integrationAuthentication);

    /** 认证结束后执行
     * @param integrationAuthentication
     */
    void complete(IntegrationAuthentication integrationAuthentication);
}
